/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "contabil_encerramento_exe_det")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ContabilEncerramentoExeDet.findAll", query = "SELECT c FROM ContabilEncerramentoExeDet c")})
public class ContabilEncerramentoExeDet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "SALDO_ANTERIOR", precision = 18, scale = 6)
    private BigDecimal saldoAnterior;
    @Column(name = "VALOR_DEBITO", precision = 18, scale = 6)
    private BigDecimal valorDebito;
    @Column(name = "VALOR_CREDITO", precision = 18, scale = 6)
    private BigDecimal valorCredito;
    @Column(precision = 18, scale = 6)
    private BigDecimal saldo;
    @JoinColumn(name = "ID_CONTABIL_CONTA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private ContabilConta idContabilConta;
    @JoinColumn(name = "ID_CONTABIL_ENCERRAMENTO_EXE", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private ContabilEncerramentoExeCab idContabilEncerramentoExe;

    public ContabilEncerramentoExeDet() {
    }

    public ContabilEncerramentoExeDet(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getSaldoAnterior() {
        return saldoAnterior;
    }

    public void setSaldoAnterior(BigDecimal saldoAnterior) {
        this.saldoAnterior = saldoAnterior;
    }

    public BigDecimal getValorDebito() {
        return valorDebito;
    }

    public void setValorDebito(BigDecimal valorDebito) {
        this.valorDebito = valorDebito;
    }

    public BigDecimal getValorCredito() {
        return valorCredito;
    }

    public void setValorCredito(BigDecimal valorCredito) {
        this.valorCredito = valorCredito;
    }

    public BigDecimal getSaldo() {
        return saldo;
    }

    public void setSaldo(BigDecimal saldo) {
        this.saldo = saldo;
    }

    public ContabilConta getIdContabilConta() {
        return idContabilConta;
    }

    public void setIdContabilConta(ContabilConta idContabilConta) {
        this.idContabilConta = idContabilConta;
    }

    public ContabilEncerramentoExeCab getIdContabilEncerramentoExe() {
        return idContabilEncerramentoExe;
    }

    public void setIdContabilEncerramentoExe(ContabilEncerramentoExeCab idContabilEncerramentoExe) {
        this.idContabilEncerramentoExe = idContabilEncerramentoExe;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ContabilEncerramentoExeDet)) {
            return false;
        }
        ContabilEncerramentoExeDet other = (ContabilEncerramentoExeDet) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.ContabilEncerramentoExeDet[ id=" + id + " ]";
    }
    
}
